<?php
namespace Mouta\AmistateBundle\Helper;

class Strings {
	
	public static function recortar($string,$len = 120)
	{
        if(strlen($string)<$len) return $string;
        $array = explode(' ', $string);
        $texto = "";
        foreach ($array as $palabra){
            if(strlen($texto)<$len)
            {
                $texto .= $palabra . " ";
            }else{
                return trim($texto);
            }
        }
        return trim($texto);
    }
}

?>
